var _bp = location.pathname.substring(0, location.pathname.indexOf("/", 1));
var _bp = "/mis";
/*
msg:短信内容
userIds:短信接收人ID，多人之间以逗号分隔
orgIds:短信接收机构，多个之间以逗号分隔
model:业务模块
mid:业务数据主键
*/
function sendSMS(msg,orgIds,userIds,model,mid){
    if(model==undefined)model='';
    if(mid==undefined)mid='';
    if(userIds==undefined)userIds='';
    if(orgIds==undefined)orgIds='';
    if(msg==undefined)msg='';
    sendMsgSrc = _bp+"/sms/outbox/SmsOutbox_add.action?op=add&model="+model+"&mid="+mid+"&org="+orgIds+"&user="+userIds+"&msg="+msg;
    console.log(sendMsgSrc);
    getSendWindow().window({width:600,height:400,title:'发送短信'});
    //清除窗口内容，避免打开窗口时显示前一操作时的页面信息内容
	getSendWindow().empty();
	//加载添加页面
	getSendWindow().html('<iframe src="'+sendMsgSrc+'" frameborder="0" style="width:100%;height:100%"></iframe>');
	//打开添加窗口
	getSendWindow().window('open');
}

function getSendWindow(){
	if($('#sendWindow').length==0){
		var div = $('<div class="easyui-window" style="width:100%;height:100%;overflow:hidden"></div>');
		div.attr({id:'sendWindow',title:'发送短信',height:30,width:300,className:'easyui-window',closed:"true",modal:"true",collapsible:"false",minimizable:"false",maximizable:"false",closable:"true"});
		div.appendTo(document.body);
	}
	return $('#sendWindow');
}

function closeSMSSendWin(){
    $.util.showTip({content:'短信已发送！'});
   	getSendWindow().window('close');
}